package pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

/**
 * Created by Mikhail.Chub on 10/06/2014.
 */
public class BasePage {

    protected PageManager pageManager;
    protected WebDriver driver;

    public BasePage(PageManager pageManager) {
        this.pageManager = pageManager;
        this.driver = pageManager.driver;
    }

//auxiliary methods
    protected void fillTxtField(By locator, String text) {
        if (text != null) {
            driver.findElement(locator).clear();
            driver.findElement(locator).sendKeys(text);
        }
    }

    protected void click(By locator) {
        driver.findElement(locator).click();
    }


}
